/* The data is available here: http://discover.ukdataservice.ac.uk/series/?sn=2000053
under Data Access expand the drop down menu and check the title below. 
6849	Understanding Society: Innovation Panel, Waves 1-6, 2008-2013


The raw data file used for the analysis: f_indresp_ip.dta */

use "C:\Users\ppatel\Desktop\MS RR2 Final Replication Code\Study 2 -- Understanding Society IP6\f_indresp_ip.dta", clear

*Create the self-employment variable
/* f_mrjsemp -- Self_employed 

              storage   display    value
variable name   type    format     label      variable label
---------------------------------------------------------------------------------------------------------------
f_mrjsemp       byte    %8.0g      f_mrjsemp
                                              Most recent job: employed or self-employed */
tab f_mrjsemp
summ f_mrjsemp, detail
* recode so that all missing values are ., 1 = self_employed 0 = employed
recode f_mrjsemp (-8/-1 = .) (1=0) (2=1) 
tab f_mrjsemp

* Controls 

	*Date of Birth
	recode f_birthy (-1=.)
	tab f_birthy, missing

	* Sex; 1 = Male; 2 = Female 
	tab f_sex
	
	* Education 
	tab f_nhiqual_dv, nolabel
	* recode missing values 
	recode f_nhiqual_dv (-9/-1 = .) 
	* 1 and 2 are college degrees; 3 is A-levels; 4 is GCSE; 5 is other qualification; 9 is no qualification
	recode f_nhiqual_dv (1=3) (2=3) (3=2) (4=2) (5=1) (9=0) 
	tab f_nhiqual_dv, nolabel
	tab f_nhiqual_dv
	
	* Race -- White or non-White 
	tab f_racel_dv, nolabel
	recode f_racel_dv (-9=.) (2/97=0)
	tab f_racel_dv, nolabel
	
	* Married or living with a partner
	tab f_scmolwp, nolabel
	recode f_scmolwp (-8/-1 = .) (2=0)
	tab f_scmolwp
	
	* General Health 
	recode  f_sf1(-9/-2=.) (5=1) (1=5) (2=4) (3=3) (4=2)
	tab f_sf1, nolabel
	
	* Long-term health condition 
	tab f_health, nolabel
	recode f_health (-9/-1=.) (2=0)
	
	* Subjective Well-being 
	tab f_scghq1_dv, nolabel
	recode f_scghq1_dv (-9/-7 = .)
	
	* Whether living in urban area 
	tab f_urban_dv, nolabel
	* 1= urban , 0=rural
	recode f_urban_dv (-9=.) (1=1) (2=0) 
	
	*Generating height and BMI variables
	clonevar height_feet = f_hlhtf
	clonevar height_inches = f_hlhti
	summ height_feet, detail
	recode height_feet (-8/0 = .)
	summ height_inches, detail
		recode height_inches (-8/-1 = .)
	generate totalheight_inches = (height_feet*12) + height_inches
	*1 inch = 0.0254 meters
	generate height_meters = totalheight_inches*0.0254 
	generate BMI = f_hlwtkrecall/( height_meters * height_meters)


* Digit Ratio 
recode f_h2d4drim - f_h2d4dlrm (-8/0=.) (996/997=.)
generate right_index = f_h2d4drim/f_h2d4drrm
generate left_index = f_h2d4dlim/f_h2d4dlrm
summ left_index right_index

tab f_nhiqual_dv, gen(education)

recode f_handed  (-8/0 = .)
recode  f_lnprnt (-8/-1 = .)

mac def controls "f_birthy  education1 - education4 f_racel_dv f_sf1 f_urban_dv f_fimngrs_dv f_handed"

*Table 3 -- Descriptive Study 2
tabstat f_mrjsemp  $controls f_sex right_index left_index, col(stat) stat(N mean sd min max) casewise
corr f_mrjsemp  $controls f_sex right_index left_index

*Table 4 right hand; Models 1 and 2
logit f_mrjsemp right_index  $controls if f_sex == 1
outreg2 using digitMSrr1.doc, replace label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "df", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))
logit f_mrjsemp right_index  $controls if f_sex == 2
outreg2 using digitMSrr1.doc, append label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "df", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))

*Table 4 left hand; Models 3 and 4
logit f_mrjsemp left_index  $controls if f_sex == 1
outreg2 using digitMSrr1.doc, append label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "df", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))
logit f_mrjsemp left_index  $controls if f_sex == 2
outreg2 using digitMSrr1.doc, append label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "df", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))

/*Additional Robustness Checks with winsorization; reported in reviewer responses
*Robustness for winsor 5%
winsor  left_index, gen(Wins5_left_index) p(0.05)
winsor  right_index, gen(Wins5_right_index) p(0.05)

logit self_employed Wins5_left_index $controls if f_sex == 1
outreg2 using Winsor52D4D02-10-2016.xls, replace tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

logit self_employed Wins5_left_index $controls if f_sex == 2
outreg2 using Winsor52D4D02-10-2016.xls, append tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

logit self_employed Wins5_right_index $controls if f_sex == 1
outreg2 using Winsor52D4D02-10-2016.xls, append tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

logit self_employed Wins5_right_index $controls if f_sex == 2
outreg2 using Winsor52D4D02-10-2016.xls, append tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

*Robustness for winsor 1%
winsor  left_index, gen(Wins1_left_index) p(0.01)
winsor  right_index, gen(Wins1_right_index) p(0.01)

logit self_employed Wins1_left_index $controls if f_sex == 1
outreg2 using Winsor12D4D02-10-2016.xls, replace tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

logit self_employed Wins1_left_index $controls if f_sex == 2
outreg2 using Winsor12D4D02-10-2016.xls, append tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

logit self_employed Wins1_right_index $controls if f_sex == 1
outreg2 using Winsor12D4D02-10-2016.xls, append tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

logit self_employed Wins1_right_index $controls if f_sex == 2
outreg2 using Winsor12D4D02-10-2016.xls, append tstat alpha(0.001, 0.01,0.05,0.10) symbol(***,**,*, +) addstat("Chi-square", e(chi2), "p-value", e(p))

*/

/*Raw output of main results

. use "C:\Users\ppatel\Desktop\MS RR2 Final Replication Code\Study 2 -- Understanding Society IP6\f_indresp_ip.dta", clear

. 
. *Create the self-employment variable
. /* f_mrjsemp -- Self_employed 
> 
>               storage   display    value
> variable name   type    format     label      variable label
> ---------------------------------------------------------------------------------------------------------------
> f_mrjsemp       byte    %8.0g      f_mrjsemp
>                                               Most recent job: employed or self-employed */
. tab f_mrjsemp

  Most recent |
job: employed |
           or |
self-employed |      Freq.     Percent        Cum.
--------------+-----------------------------------
 Inapplicable |        510       23.73       23.73
        proxy |         31        1.44       25.17
      Refusal |          1        0.05       25.22
   Don't know |          3        0.14       25.36
     Employee |      1,372       63.84       89.20
Self-employed |        232       10.80      100.00
--------------+-----------------------------------
        Total |      2,149      100.00

. summ f_mrjsemp, detail

         Most recent job: employed or self-employed
-------------------------------------------------------------
      Percentiles      Smallest
 1%           -8             -8
 5%           -8             -8
10%           -8             -8       Obs               2,149
25%           -7             -8       Sum of Wgt.       2,149

50%            1                      Mean           -1.14751
                        Largest       Std. Dev.      3.957187
75%            1              2
90%            2              2       Variance       15.65933
95%            2              2       Skewness      -1.123398
99%            2              2       Kurtosis       2.303677

. * recode so that all missing values are ., 1 = self_employed 0 = employed
. recode f_mrjsemp (-8/-1 = .) (1=0) (2=1) 
(f_mrjsemp: 2149 changes made)

. tab f_mrjsemp

  Most recent |
job: employed |
           or |
self-employed |      Freq.     Percent        Cum.
--------------+-----------------------------------
            0 |      1,372       85.54       85.54
     Employee |        232       14.46      100.00
--------------+-----------------------------------
        Total |      1,604      100.00

. 
. * Controls 
. 
.         *Date of Birth
.         recode f_birthy (-1=.)
(f_birthy: 3 changes made)

.         tab f_birthy, missing

    DOB Year |      Freq.     Percent        Cum.
-------------+-----------------------------------
        1916 |          1        0.05        0.05
        1917 |          2        0.09        0.14
        1918 |          1        0.05        0.19
        1919 |          1        0.05        0.23
        1920 |          4        0.19        0.42
        1921 |          3        0.14        0.56
        1922 |          3        0.14        0.70
        1923 |          4        0.19        0.88
        1924 |          4        0.19        1.07
        1925 |          3        0.14        1.21
        1926 |          6        0.28        1.49
        1927 |          6        0.28        1.77
        1928 |         15        0.70        2.47
        1929 |          7        0.33        2.79
        1930 |          9        0.42        3.21
        1931 |          6        0.28        3.49
        1932 |         13        0.60        4.09
        1933 |         18        0.84        4.93
        1934 |         17        0.79        5.72
        1935 |         19        0.88        6.61
        1936 |         24        1.12        7.72
        1937 |         18        0.84        8.56
        1938 |         28        1.30        9.87
        1939 |         29        1.35       11.21
        1940 |         17        0.79       12.01
        1941 |         24        1.12       13.12
        1942 |         25        1.16       14.29
        1943 |         23        1.07       15.36
        1944 |         45        2.09       17.45
        1945 |         39        1.81       19.26
        1946 |         26        1.21       20.47
        1947 |         41        1.91       22.38
        1948 |         47        2.19       24.57
        1949 |         28        1.30       25.87
        1950 |         37        1.72       27.59
        1951 |         28        1.30       28.90
        1952 |         41        1.91       30.81
        1953 |         40        1.86       32.67
        1954 |         34        1.58       34.25
        1955 |         46        2.14       36.39
        1956 |         46        2.14       38.53
        1957 |         38        1.77       40.30
        1958 |         39        1.81       42.11
        1959 |         44        2.05       44.16
        1960 |         36        1.68       45.84
        1961 |         32        1.49       47.32
        1962 |         41        1.91       49.23
        1963 |         47        2.19       51.42
        1964 |         55        2.56       53.98
        1965 |         36        1.68       55.65
        1966 |         36        1.68       57.33
        1967 |         44        2.05       59.38
        1968 |         42        1.95       61.33
        1969 |         40        1.86       63.19
        1970 |         27        1.26       64.45
        1971 |         40        1.86       66.31
        1972 |         27        1.26       67.57
        1973 |         31        1.44       69.01
        1974 |         25        1.16       70.17
        1975 |         31        1.44       71.61
        1976 |         37        1.72       73.34
        1977 |         26        1.21       74.55
        1978 |         30        1.40       75.94
        1979 |         27        1.26       77.20
        1980 |         33        1.54       78.73
        1981 |         26        1.21       79.94
        1982 |         26        1.21       81.15
        1983 |         27        1.26       82.41
        1984 |         20        0.93       83.34
        1985 |         21        0.98       84.32
        1986 |         29        1.35       85.67
        1987 |         22        1.02       86.69
        1988 |         21        0.98       87.67
        1989 |         26        1.21       88.88
        1990 |         25        1.16       90.04
        1991 |         30        1.40       91.44
        1992 |         30        1.40       92.83
        1993 |         38        1.77       94.60
        1994 |         29        1.35       95.95
        1995 |         39        1.81       97.77
        1996 |         36        1.68       99.44
        1997 |          9        0.42       99.86
           . |          3        0.14      100.00
-------------+-----------------------------------
       Total |      2,149      100.00

. 
.         * Sex; 1 = Male; 2 = Female 
.         tab f_sex

        Sex  |      Freq.     Percent        Cum.
-------------+-----------------------------------
        Male |      1,000       46.53       46.53
      Female |      1,149       53.47      100.00
-------------+-----------------------------------
       Total |      2,149      100.00

.         
.         * Education 
.         tab f_nhiqual_dv, nolabel

      Newly |
   reported |
    highest |
educational |
qualificati |
         on |      Freq.     Percent        Cum.
------------+-----------------------------------
         -9 |        112        5.21        5.21
         -8 |         61        2.84        8.05
          1 |        425       19.78       27.83
          2 |        238       11.07       38.90
          3 |        387       18.01       56.91
          4 |        423       19.68       76.59
          5 |        122        5.68       82.27
          9 |        381       17.73      100.00
------------+-----------------------------------
      Total |      2,149      100.00

.         * recode missing values 
.         recode f_nhiqual_dv (-9/-1 = .) 
(f_nhiqual_dv: 173 changes made)

.         * 1 and 2 are college degrees; 3 is A-levels; 4 is GCSE; 5 is other qualification; 9 is no qualification
.         recode f_nhiqual_dv (1=3) (2=3) (3=2) (4=2) (5=1) (9=0) 
(f_nhiqual_dv: 1976 changes made)

.         tab f_nhiqual_dv, nolabel

      Newly |
   reported |
    highest |
educational |
qualificati |
         on |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        381       19.28       19.28
          1 |        122        6.17       25.46
          2 |        810       40.99       66.45
          3 |        663       33.55      100.00
------------+-----------------------------------
      Total |      1,976      100.00

.         tab f_nhiqual_dv

     Newly reported |
highest educational |
      qualification |      Freq.     Percent        Cum.
--------------------+-----------------------------------
                  0 |        381       19.28       19.28
             Degree |        122        6.17       25.46
Other higher degree |        810       40.99       66.45
        A-level etc |        663       33.55      100.00
--------------------+-----------------------------------
              Total |      1,976      100.00

.         
.         * Race -- White or non-White 
.         tab f_racel_dv, nolabel

     Ethnic |
      Group |      Freq.     Percent        Cum.
------------+-----------------------------------
         -9 |        250       11.63       11.63
          1 |      1,724       80.22       91.86
          2 |          5        0.23       92.09
          4 |         43        2.00       94.09
          5 |         12        0.56       94.65
          6 |          5        0.23       94.88
          7 |          3        0.14       95.02
          8 |          4        0.19       95.21
          9 |         22        1.02       96.23
         10 |         30        1.40       97.63
         11 |          1        0.05       97.67
         12 |          4        0.19       97.86
         13 |          7        0.33       98.19
         14 |          9        0.42       98.60
         15 |         14        0.65       99.26
         97 |         16        0.74      100.00
------------+-----------------------------------
      Total |      2,149      100.00

.         recode f_racel_dv (-9=.) (2/97=0)
(f_racel_dv: 425 changes made)

.         tab f_racel_dv, nolabel

     Ethnic |
      Group |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        175        9.22        9.22
          1 |      1,724       90.78      100.00
------------+-----------------------------------
      Total |      1,899      100.00

.         
.         * Married or living with a partner
.         tab f_scmolwp, nolabel

    Are you |
 married or |
living with |
  a partner |      Freq.     Percent        Cum.
------------+-----------------------------------
         -8 |      1,646       76.59       76.59
         -7 |        125        5.82       82.41
         -1 |          2        0.09       82.50
          1 |        239       11.12       93.62
          2 |        137        6.38      100.00
------------+-----------------------------------
      Total |      2,149      100.00

.         recode f_scmolwp (-8/-1 = .) (2=0)
(f_scmolwp: 1910 changes made)

.         tab f_scmolwp

     Are you |
  married or |
 living with |
   a partner |      Freq.     Percent        Cum.
-------------+-----------------------------------
           0 |        137       36.44       36.44
         Yes |        239       63.56      100.00
-------------+-----------------------------------
       Total |        376      100.00

.         
.         * General Health 
.         recode  f_sf1(-9/-2=.) (5=1) (1=5) (2=4) (3=3) (4=2)
(f_sf1: 1518 changes made)

.         tab f_sf1, nolabel

    GENERAL |
   HEALTH   |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        138        6.43        6.43
          2 |        321       14.95       21.38
          3 |        631       29.39       50.77
          4 |        729       33.95       84.72
          5 |        328       15.28      100.00
------------+-----------------------------------
      Total |      2,147      100.00

.         
.         * Long-term health condition 
.         tab f_health, nolabel

Long-standi |
 ng illness |
         or |
disability  |      Freq.     Percent        Cum.
------------+-----------------------------------
         -9 |          1        0.05        0.05
         -8 |        431       20.06       20.10
         -2 |          2        0.09       20.20
         -1 |          2        0.09       20.29
          1 |        610       28.39       48.67
          2 |      1,103       51.33      100.00
------------+-----------------------------------
      Total |      2,149      100.00

.         recode f_health (-9/-1=.) (2=0)
(f_health: 1539 changes made)

.         
.         * Subjective Well-being 
.         tab f_scghq1_dv, nolabel

 Subjective |
  wellbeing |
     (GHQ): |
     Likert |      Freq.     Percent        Cum.
------------+-----------------------------------
         -9 |         30        1.40        1.40
         -8 |        299       13.91       15.31
         -7 |        125        5.82       21.13
          0 |          3        0.14       21.27
          1 |          2        0.09       21.36
          2 |          4        0.19       21.54
          3 |          9        0.42       21.96
          4 |         13        0.60       22.57
          5 |         34        1.58       24.15
          6 |        172        8.00       32.15
          7 |        164        7.63       39.79
          8 |        172        8.00       47.79
          9 |        131        6.10       53.89
         10 |        167        7.77       61.66
         11 |        170        7.91       69.57
         12 |        188        8.75       78.32
         13 |         66        3.07       81.39
         14 |         67        3.12       84.50
         15 |         42        1.95       86.46
         16 |         44        2.05       88.51
         17 |         47        2.19       90.69
         18 |         33        1.54       92.23
         19 |         20        0.93       93.16
         20 |         26        1.21       94.37
         21 |         23        1.07       95.44
         22 |         18        0.84       96.28
         23 |         16        0.74       97.02
         24 |          8        0.37       97.39
         25 |         11        0.51       97.91
         26 |         12        0.56       98.46
         27 |          5        0.23       98.70
         28 |          4        0.19       98.88
         29 |          7        0.33       99.21
         30 |          4        0.19       99.40
         31 |          5        0.23       99.63
         32 |          2        0.09       99.72
         33 |          1        0.05       99.77
         34 |          3        0.14       99.91
         35 |          1        0.05       99.95
         36 |          1        0.05      100.00
------------+-----------------------------------
      Total |      2,149      100.00

.         recode f_scghq1_dv (-9/-7 = .)
(f_scghq1_dv: 454 changes made)

.         
.         * Whether living in urban area 
.         tab f_urban_dv, nolabel

   Urban or |
rural area, |
    derived |      Freq.     Percent        Cum.
------------+-----------------------------------
         -9 |          6        0.28        0.28
          1 |      1,621       75.43       75.71
          2 |        522       24.29      100.00
------------+-----------------------------------
      Total |      2,149      100.00

.         * 1= urban , 0=rural
.         recode f_urban_dv (-9=.) (1=1) (2=0) 
(f_urban_dv: 528 changes made)

.         
.         *Generating height and BMI variables
.         clonevar height_feet = f_hlhtf

.         clonevar height_inches = f_hlhti

.         summ height_feet, detail

                      HEIGHT IN FEET  
-------------------------------------------------------------
      Percentiles      Smallest
 1%           -8             -8
 5%           -8             -8
10%           -7             -8       Obs               2,149
25%            5             -8       Sum of Wgt.       2,149

50%            5                      Mean           3.591438
                        Largest       Std. Dev.      4.119789
75%            5              6
90%            6              7       Variance       16.97266
95%            6              8       Skewness      -2.306374
99%            6              8       Kurtosis       6.423142

.         recode height_feet (-8/0 = .)
(height_feet: 260 changes made)

.         summ height_inches, detail

                      HEIGHT IN INCHES
-------------------------------------------------------------
      Percentiles      Smallest
 1%           -8             -8
 5%           -8             -8
10%           -7             -8       Obs               2,149
25%            1             -8       Sum of Wgt.       2,149

50%            4                      Mean             3.7906
                        Largest       Std. Dev.      5.287796
75%            8             11
90%           10             11       Variance       27.96079
95%           11             11       Skewness      -.8254885
99%           11             11       Kurtosis       3.052366

.                 recode height_inches (-8/-1 = .)
(height_inches: 269 changes made)

.         generate totalheight_inches = (height_feet*12) + height_inches
(269 missing values generated)

.         *1 inch = 0.0254 meters
.         generate height_meters = totalheight_inches*0.0254 
(269 missing values generated)

.         generate BMI = f_hlwtkrecall/( height_meters * height_meters)
(269 missing values generated)

. 
. 
. * Digit Ratio 
. recode f_h2d4drim - f_h2d4dlrm (-8/0=.) (996/997=.)
(f_h2d4drim: 652 changes made)
(f_h2d4drrm: 654 changes made)
(f_h2d4dlim: 653 changes made)
(f_h2d4dlrm: 655 changes made)

. generate right_index = f_h2d4drim/f_h2d4drrm
(656 missing values generated)

. generate left_index = f_h2d4dlim/f_h2d4dlrm
(655 missing values generated)

. summ left_index right_index

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  left_index |      1,494     1.00272    .0841653   .5733333       2.75
 right_index |      1,493    1.002879    .1210493   .3295455   3.190476

. 
. tab f_nhiqual_dv, gen(education)

     Newly reported |
highest educational |
      qualification |      Freq.     Percent        Cum.
--------------------+-----------------------------------
                  0 |        381       19.28       19.28
             Degree |        122        6.17       25.46
Other higher degree |        810       40.99       66.45
        A-level etc |        663       33.55      100.00
--------------------+-----------------------------------
              Total |      1,976      100.00

. 
. recode f_handed  (-8/0 = .)
(f_handed: 534 changes made)

. recode  f_lnprnt (-8/-1 = .)
(f_lnprnt: 2099 changes made)

. 
. mac def controls "f_birthy  education1 - education4 f_racel_dv f_sf1 f_urban_dv f_fimngrs_dv f_handed"

. 
. *Table 3 -- Descriptive Study 2
. tabstat f_mrjsemp  $controls f_sex right_index left_index, col(stat) stat(N mean sd min max) casewise

    variable |         N      mean        sd       min       max
-------------+--------------------------------------------------
   f_mrjsemp |       971  .1524202  .3596129         0         1
    f_birthy |       971  1963.578  15.56141      1920      1996
  education1 |       971  .1431514  .3504077         0         1
  education2 |       971  .0525232  .2231945         0         1
  education3 |       971  .3934089   .488758         0         1
  education4 |       971  .4109166  .4922537         0         1
  f_racel_dv |       971  .8949537  .3067711         0         1
       f_sf1 |       971  3.465499  1.047134         1         5
  f_urban_dv |       971  .7415036  .4380338         0         1
f_fimngrs_dv |       971  2939.206  21883.65 -730.9302  666546.4
    f_handed |       971  1.124614  .3770774         1         3
       f_sex |       971   1.53862  .4987632         1         2
 right_index |       971  .9969489  .0812071  .3295455  2.147059
  left_index |       971  1.002606  .0748308  .5733333  2.368421
----------------------------------------------------------------

. corr f_mrjsemp  $controls f_sex right_index left_index
(obs=971)

             | f_mrjs~p f_birthy educat~1 educat~2 educat~3 educat~4 f_race~v    f_sf1 f_urba~v f_fimn.. f_handed    f_sex
-------------+------------------------------------------------------------------------------------------------------------
   f_mrjsemp |   1.0000
    f_birthy |  -0.0959   1.0000
  education1 |  -0.0015  -0.3442   1.0000
  education2 |  -0.0356  -0.0634  -0.0962   1.0000
  education3 |  -0.0013   0.2170  -0.3292  -0.1896   1.0000
  education4 |   0.0185   0.0582  -0.3414  -0.1966  -0.6726   1.0000
  f_racel_dv |  -0.0416  -0.0873   0.0441  -0.0097   0.1521  -0.1781   1.0000
       f_sf1 |  -0.0107   0.2374  -0.1790  -0.0430   0.0366   0.1105  -0.0145   1.0000
  f_urban_dv |  -0.0703   0.0451   0.0466   0.0547  -0.0060  -0.0519  -0.1409  -0.0790   1.0000
f_fimngrs_dv |  -0.0218  -0.0125  -0.0266  -0.0159   0.0281  -0.0018  -0.0040   0.0343  -0.0539   1.0000
    f_handed |   0.0422  -0.0116   0.0053   0.0569  -0.0313   0.0016  -0.0026   0.0096   0.0205  -0.0123   1.0000
       f_sex |  -0.1363   0.0501  -0.0051   0.0420  -0.0201   0.0046  -0.0274   0.0248  -0.0180  -0.0493  -0.0887   1.0000
 right_index |  -0.0096  -0.0007  -0.0509   0.0259  -0.0167   0.0411  -0.0693  -0.0430   0.0770   0.0205  -0.0308   0.0081
  left_index |  -0.0872  -0.0033  -0.0302  -0.0033   0.0497  -0.0263  -0.0336  -0.0407   0.0277  -0.0178   0.0015   0.0802

             | right_~x left_i~x
-------------+------------------
 right_index |   1.0000
  left_index |   0.4460   1.0000


. 
. *Table 4 right hand; Models 1 and 2
. logit f_mrjsemp right_index  $controls if f_sex == 1

note: education4 omitted because of collinearity
Iteration 0:   log likelihood = -229.27799  
Iteration 1:   log likelihood = -220.75012  
Iteration 2:   log likelihood = -220.19844  
Iteration 3:   log likelihood = -217.98477  
Iteration 4:   log likelihood = -217.41267  
Iteration 5:   log likelihood = -217.40831  
Iteration 6:   log likelihood = -217.40831  

Logistic regression                             Number of obs     =        450
                                                LR chi2(10)       =      23.74
                                                Prob > chi2       =     0.0083
Log likelihood = -217.40831                     Pseudo R2         =     0.0518

------------------------------------------------------------------------------
   f_mrjsemp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 right_index |   .5201868   2.032548     0.26   0.798    -3.463535    4.503908
    f_birthy |  -.0262044   .0084275    -3.11   0.002    -.0427219   -.0096869
  education1 |  -.3129122   .3819564    -0.82   0.413    -1.061533    .4357086
  education2 |  -.9442289   .7941489    -1.19   0.234    -2.500732    .6122742
  education3 |   .1638373   .2782382     0.59   0.556    -.3814996    .7091742
  education4 |          0  (omitted)
  f_racel_dv |  -.5350322    .394717    -1.36   0.175    -1.308663    .2385988
       f_sf1 |   .1679537   .1216441     1.38   0.167    -.0704642    .4063717
  f_urban_dv |  -.5960437   .2660587    -2.24   0.025    -1.117509   -.0745783
f_fimngrs_dv |  -.0001756   .0000846    -2.08   0.038    -.0003415   -9.77e-06
    f_handed |   .2847496   .2574254     1.11   0.269    -.2197948    .7892941
       _cons |   49.94607   16.62711     3.00   0.003     17.35752    82.53461
------------------------------------------------------------------------------
Note: 1 failure and 0 successes completely determined.

. outreg2 using digitMSrr1.doc, replace label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "
> df", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))
digitMSrr1.doc
dir : seeout

. logit f_mrjsemp right_index  $controls if f_sex == 2

note: education4 omitted because of collinearity
Iteration 0:   log likelihood = -178.11879  
Iteration 1:   log likelihood = -172.83033  
Iteration 2:   log likelihood = -170.75728  
Iteration 3:   log likelihood = -170.36119  
Iteration 4:   log likelihood = -170.35936  
Iteration 5:   log likelihood = -170.35936  

Logistic regression                             Number of obs     =        524
                                                LR chi2(10)       =      15.52
                                                Prob > chi2       =     0.1143
Log likelihood = -170.35936                     Pseudo R2         =     0.0436

------------------------------------------------------------------------------
   f_mrjsemp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 right_index |   -1.11667    1.60808    -0.69   0.487    -4.268448    2.035109
    f_birthy |  -.0174834   .0104526    -1.67   0.094    -.0379702    .0030034
  education1 |  -.7371471   .4977437    -1.48   0.139    -1.712707    .2384127
  education2 |  -.6385947   .6663938    -0.96   0.338    -1.944703    .6675132
  education3 |  -.5310525   .3479516    -1.53   0.127    -1.213025    .1509202
  education4 |          0  (omitted)
  f_racel_dv |  -.5619751   .4242585    -1.32   0.185    -1.393507    .2695563
       f_sf1 |  -.1214528   .1446849    -0.84   0.401      -.40503    .1621245
  f_urban_dv |  -.4260466   .3209935    -1.33   0.184    -1.055182    .2030891
f_fimngrs_dv |  -.0003125   .0001451    -2.15   0.031     -.000597   -.0000281
    f_handed |   .3034134   .4120453     0.74   0.462    -.5041805    1.111007
       _cons |   34.98289   20.64086     1.69   0.090    -5.472448    75.43822
------------------------------------------------------------------------------
Note: 1 failure and 0 successes completely determined.

. outreg2 using digitMSrr1.doc, append label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "d
> f", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))
digitMSrr1.doc
dir : seeout

. 
. *Table 4 left hand; Models 3 and 4
. logit f_mrjsemp left_index  $controls if f_sex == 1

note: education4 omitted because of collinearity
Iteration 0:   log likelihood = -227.69705  
Iteration 1:   log likelihood = -216.20974  
Iteration 2:   log likelihood =  -215.4553  
Iteration 3:   log likelihood = -212.91654  
Iteration 4:   log likelihood = -212.39768  
Iteration 5:   log likelihood = -212.39588  
Iteration 6:   log likelihood = -212.39588  

Logistic regression                             Number of obs     =        449
                                                LR chi2(10)       =      30.60
                                                Prob > chi2       =     0.0007
Log likelihood = -212.39588                     Pseudo R2         =     0.0672

------------------------------------------------------------------------------
   f_mrjsemp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  left_index |    -7.6058   2.753118    -2.76   0.006    -13.00181   -2.209788
    f_birthy |  -.0270256    .008574    -3.15   0.002    -.0438302   -.0102209
  education1 |  -.4872094   .3945802    -1.23   0.217    -1.260572    .2861536
  education2 |  -.9496807   .8010932    -1.19   0.236    -2.519795    .6204332
  education3 |   .2335785   .2807283     0.83   0.405    -.3166388    .7837958
  education4 |          0  (omitted)
  f_racel_dv |  -.6011052   .3997186    -1.50   0.133    -1.384539    .1823288
       f_sf1 |   .1207964   .1234209     0.98   0.328    -.1211042     .362697
  f_urban_dv |  -.5428171   .2705028    -2.01   0.045    -1.072993   -.0126413
f_fimngrs_dv |  -.0001854   .0000855    -2.17   0.030    -.0003529   -.0000178
    f_handed |    .280373    .262041     1.07   0.285    -.2332179     .793964
       _cons |    59.8159    17.1744     3.48   0.000      26.1547     93.4771
------------------------------------------------------------------------------
Note: 1 failure and 0 successes completely determined.

. outreg2 using digitMSrr1.doc, append label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "d
> f", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))
digitMSrr1.doc
dir : seeout

. logit f_mrjsemp left_index  $controls if f_sex == 2

note: education4 omitted because of collinearity
Iteration 0:   log likelihood = -178.23169  
Iteration 1:   log likelihood = -171.90328  
Iteration 2:   log likelihood = -169.68161  
Iteration 3:   log likelihood = -169.09659  
Iteration 4:   log likelihood = -169.09171  
Iteration 5:   log likelihood = -169.09171  

Logistic regression                             Number of obs     =        525
                                                LR chi2(10)       =      18.28
                                                Prob > chi2       =     0.0504
Log likelihood = -169.09171                     Pseudo R2         =     0.0513

------------------------------------------------------------------------------
   f_mrjsemp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  left_index |  -4.018575   2.255228    -1.78   0.075     -8.43874    .4015911
    f_birthy |  -.0175611   .0105339    -1.67   0.095    -.0382073     .003085
  education1 |  -.7040029   .5001534    -1.41   0.159    -1.684285    .2762797
  education2 |  -.6395702   .6675783    -0.96   0.338       -1.948    .6688591
  education3 |  -.4944742   .3466471    -1.43   0.154     -1.17389    .1849416
  education4 |          0  (omitted)
  f_racel_dv |  -.6339204   .4272424    -1.48   0.138      -1.4713    .2034593
       f_sf1 |  -.1225826   .1450442    -0.85   0.398     -.406864    .1616989
  f_urban_dv |   -.436086   .3193474    -1.37   0.172    -1.061995    .1898234
f_fimngrs_dv |  -.0003205   .0001467    -2.18   0.029     -.000608    -.000033
    f_handed |    .327006   .4188902     0.78   0.435    -.4940036    1.148016
       _cons |   38.08025   20.95778     1.82   0.069    -2.996245    79.15675
------------------------------------------------------------------------------
Note: 1 failure and 0 successes completely determined.

. outreg2 using digitMSrr1.doc, append label tstat alpha(0.001,0.01,0.05,0.10) symbol(***,**,*,+) addstat("Chi-2",e(chi2), "d
> f", e(df_m), "p-value", e(p), "Pseudo-R2", e(r2_p))
digitMSrr1.doc
dir : seeout

. 
end of do-file
*/
